﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace ZhimeiSoft.CharmManager.DOL
{
    public class DBEntityReservationServiceItem : DBEntityBase
    {
        public override string GetTableName()
        {
            return "RESERVATIONSERVICEITEM";
        }
        public DBEntityReservationServiceItem()
            : base()
        {
            PRESERVATIONID = -1;
            RESERVATIONSTATE = "C0U";
        }
        public DBEntityReservationServiceItem(DataRow drRow):this()
        {
            this.RESERVATIONID = Convert.ToInt32(drRow[DBEntityReservationServiceItem.FieldName.RESERVATIONID]);
            this.EMPLOYEEID = Convert.ToInt32(drRow[DBEntityReservationServiceItem.FieldName.EMPLOYEEID]);
            this.CUSTOMERSERVICEITEMID = Convert.ToInt32(drRow[DBEntityReservationServiceItem.FieldName.CUSTOMERSERVICEITEMID]);
            this.RESERVATIONSTATE = drRow[DBEntityReservationServiceItem.FieldName.RESERVATIONSTATE].ToString();
            if (drRow[DBEntityReservationServiceItem.FieldName.PRESERVATIONID] == System.DBNull.Value)
            {
                this.PRESERVATIONID = -1;
            }
            else
            {
                this.PRESERVATIONID = Convert.ToInt32(drRow[DBEntityReservationServiceItem.FieldName.PRESERVATIONID]);
            }
        }
        /// <summary>
        /// 预约表ID
        /// </summary>
        public int RESERVATIONID{get; set;}
        /// <summary>
        /// 员工表ID
        /// </summary>
        public int EMPLOYEEID { get; set; }
        /// <summary>
        /// 会员服务项目ID
        /// </summary>
        public int CUSTOMERSERVICEITEMID{ get; set; }
        /// <summary>
        /// 服务状态 C0A 服务完成已经添加预约， C0U未完成， C0E推迟已经添加预约(添加下一次的预约ID)
        /// </summary>
        public string RESERVATIONSTATE{ get; set; }
        /// <summary>
        /// 下一次的预约ID 默认为 -1
        /// </summary>
        public int PRESERVATIONID { get; set; }
        
        
        /// <summary>
        /// 字段
        /// </summary>
        public static class FieldName
        {
            /// <summary>
            /// 预约表ID
            /// </summary>
            public const string RESERVATIONID = "RESERVATIONID";
            /// <summary>
            /// 员工表ID
            /// </summary>
            public const string EMPLOYEEID = "EMPLOYEEID";
            /// <summary>
            /// 会员服务项目ID
            /// </summary>
            public const string CUSTOMERSERVICEITEMID = "CUSTOMERSERVICEITEMID";
            /// <summary>
            /// 服务状态 C0A 服务完成已经添加预约， C0U未完成， C0E推迟已经添加预约(添加下一次的预约ID)
            /// </summary>
            public const string RESERVATIONSTATE = "RESERVATIONSTATE";
            /// <summary>
            /// 下一次的预约ID 默认为 -1
            /// </summary>
            public const string PRESERVATIONID = "PRESERVATIONID";
        }

        /// <summary>
        /// 服务状态
        /// </summary>
        public static class ENUM_RESERVATIONSTATE
        {
            /// <summary>
            /// 服务完成
            /// </summary>
            public const string C0A = "C0A";
            /// <summary>
            /// 未服务
            /// </summary>
            public const string C0U = "C0U";
            /// <summary>
            /// 服务推迟
            /// </summary>
            public const string C0E = "C0E";
            /// <summary>
            /// 服务完成
            /// </summary>
            public const string C0A_CHINESE = "服务完成";
            /// <summary>
            /// 未服务
            /// </summary>
            public const string C0U_CHINESE = "未服务";
            /// <summary>
            /// 服务推迟
            /// </summary>
            public const string C0E_CHINESE = "服务推迟";
            /// <summary>
            /// 根据枚举值返回中文
            /// </summary>
            /// <param name="cState">枚举值</param>
            /// <returns>返回中文</returns>
            public static string EnumStrToChineseStr(string cState)
            {
                string[] serchStr = new string[] { C0A, C0U, C0E };
                string[] sReturnStr = new string[] { C0A_CHINESE, C0U_CHINESE, C0E_CHINESE };
                return DBEntityBase.GetStrReturnStr(cState, serchStr, sReturnStr);
            }
            /// <summary>
            /// 根据中文返回枚举值
            /// </summary>
            /// <param name="chineseStr">中文</param>
            /// <returns>返回枚举字符串</returns>
            public static string ChineseStrToEnumStr(string chineseStr)
            {
                string[] serchStr = new string[] { C0A_CHINESE, C0U_CHINESE, C0E_CHINESE };
                string[] sReturnStr = new string[] { C0A, C0U, C0E };
                return DBEntityBase.GetStrReturnStr(chineseStr, serchStr, sReturnStr);
            }

        }
    }
}
